//
//  ExtensionListCellModel.m
//  EnvironmentalProtection
//
//  Created by HCreater on 2018/12/19.
//  Copyright © 2018年 HCreater. All rights reserved.
//

#import "ExtensionListCellModel.h"

@interface ExtensionListCellModel ()

@property (nonatomic, readwrite, copy) NSString* city;
@property (nonatomic, readwrite, copy) NSString* date;

@end

@implementation ExtensionListCellModel

- (instancetype)initWithData:(id)data cellHeight:(CGFloat)cellHeight
{
    self = [super init];
    if (self)
    {
        _data = data;
        
        /// cellHeight+2（2容错）
        _cellHeight = MHUIScaleValue(cellHeight)+2;
        
        @weakify(self);
        [[RACObserve(self, data) distinctUntilChanged] subscribeNext:^(id x)
         {
             @strongify(self);
             
         }];
        
        self.renewCommand = [[RACCommand alloc] initWithSignalBlock:^RACSignal *(id input)
        {
            @strongify(self);
            
            return [RACSignal createSignal:^RACDisposable *(id<RACSubscriber> subscriber)
            {
                [subscriber sendNext:nil];
                [subscriber sendCompleted];
                
                return nil;
            }];
        }];
    }
    
    return self;
}

@end
